package cn.edu.zufe.mjt.insight;

/**
 * @author 蒙锦涛
 * @date 2025/5/19
 * @description 自定义拒绝策略，丢弃任务
 */


public class DiscardRejectHandle implements RejectHandle{
    @Override
    public void reject(Runnable rejectCommand, MyThreadPool threadPool) {
        Runnable poll = threadPool.blockingQueue.poll();
        threadPool.execute(rejectCommand);
        System.out.println("扔掉了：" + Thread.currentThread().getName() + " 任务：" + poll);
    }
}
